package br.com.lazyprogrammer.spaceshooter;

import android.opengl.GLES20;
import android.opengl.GLU;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import br.com.lazyprogrammer.spaceshooter.manager.FontManager;
import br.com.lazyprogrammer.spaceshooter.manager.ImageManager;
import br.com.lazyprogrammer.spaceshooter.model.renderer.WorldRenderer;
import br.com.lazyprogrammer.spaceshooter.screen.StartScreen;
import br.com.limaogames.framework.Screen;
import br.com.limaogames.framework.impl.GLGame;

/**
 * Created by LimaoGames on 19/8/2014.
 */
public class GameCore extends GLGame {
    private boolean isFirstTimeCreated = true;
    private FontManager fontManager;
    private ImageManager imageManager;

    @Override
    public Screen getStartScreen() {
        return new StartScreen(this);
    }

    @Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        super.onSurfaceCreated(gl, config);

        if (isFirstTimeCreated) {
            imageManager = new ImageManager();
            imageManager.load(this);
            fontManager = new FontManager();
            fontManager.load(this);
            isFirstTimeCreated = false;
        } else {
            imageManager.reload();
            fontManager.reload();
        }
    }

    @Override
    public void pause() {

    }

    @Override
    public void restart() {

    }

    @Override
    public void resume() {

    }
}
